﻿using Core.Module.SerializerService;
using DotNetCore.CAP;
using System;
using System.Collections.Generic;
using System.Text;

namespace Core.Module.CapSubsribeService
{    
    public class MsgSubscibeService:IMsgSubscibeService,ICapSubscribe
    {
        private IMsgSerializer _msgSerializer;
        public MsgSubscibeService(IMsgSerializer msgSerializer)
        {
            _msgSerializer = msgSerializer;
        }
        [CapSubscribe("helloworld")]
        public void ReceivedMsg(List<DtoModel> msg)
        {
            Console.WriteLine("服务接收消息:"+ _msgSerializer.Serialize(msg));
            System.Diagnostics.Debug.WriteLine("服务接收消息:"+_msgSerializer.Serialize(msg));
        }
    }
}
